<template>
  <div class="hello">
    <h1>{{ msg }}
      <h2>
        this is h2
        <Button @click="click2">添加</Button>
      </h2>
    </h1>
    <h2>Essential Links</h2>
    <div class="hello-tip fz-60 w-200">
      this is tip
    </div>
    <div style="margin-left:300px;margin-top:30px;" >
      <Button @click="click" type="error">删除</Button>
    </div>

    <Button type="info" @click="click">跳转到登录</Button>
    <Button type="success">Success</Button>
    <Button type="warning">Warning</Button>
    <Button type="error">Error</Button>

     <Button type="primary" shape="circle" icon="ios-search"></Button>
     <Button type="primary" shape="circle" icon="ios-search">确定</Button>

    <Input v-model="value" placeholder="Enter something..." style="width: 300px" />

    <RadioGroup v-model="button1" type="button">
        <Radio label="北京"></Radio>
        <Radio label="上海"></Radio>
        <Radio label="深圳"></Radio>
        <Radio label="杭州"></Radio>
    </RadioGroup>

    <CheckboxGroup v-model="fruit">
        <Checkbox label="香蕉"></Checkbox>
        <Checkbox label="苹果"></Checkbox>
        <Checkbox label="西瓜"></Checkbox>
    </CheckboxGroup>

    <Col span="12">
        <DatePicker type="date" placeholder="Select date" style="width: 200px" @on-change="onChange"></DatePicker>
    </Col>

    <router-link to="/login">Go to Login</router-link>
  </div>
</template>

<script>
// import Button from './Button.vue'
export default {
  name: 'HelloWorld',
  components: {
    // Button
  },
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      value: '',
      button1: '深圳',
      fruit: []
    }
  },
  methods: {
    click (e) {
      console.log('--------------', this.value, this.button1, this.fruit)
      // this.$router.push('login')
      this.$router.push({ path: 'login', query: { id: '123', name: 'abc' } })
    },
    click2 (e) {
      console.log('this is click2')
    },
    onChange (v) {
      console.log(v)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->

<style scoped lang="scss">
$width: 400px;
$height: 200px;

@function fn ($height) {
  @return  $height / 3;
}

@mixin rounded-corners($radius) {
  -moz-border-radius: $radius;
  -webkit-border-radius: $radius;
  border-radius: $radius;
}

.hello {
  h1 {
    color: red;
    h2 {
      color: blue;
      &:hover {
        color: black;
      }
    }
  }
  h2 {
    color: green;
  }
  &-tip {
    color: greenyellow;
    font: {
        weight: bold;
        style: italic;
    }
    @include rounded-corners(30px);
    width: $width;
    height: fn(900px);
    background: gray;
    @if $width > 2000px {
      color: rebeccapurple;
    }
  }
}
</style>
